package com.dognessnetwork.operation.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dognessnetwork.operation.baseservice.DeviceProductService;
import com.dognessnetwork.operation.dognecklace.domain.DeviceProduct;

@RestController
@RequestMapping("/deviceproduct")
public class DeviceProductServiceJsonController {

	private @Autowired DeviceProductService deviceProductService;
	
	@PostMapping(value="/save")
	public DeviceProduct save(DeviceProduct deviceProduct) {
		
		DeviceProduct DeviceProduct = deviceProductService.save(deviceProduct);
		return DeviceProduct;
	}
	
	@PostMapping(value="/delete_by_id")
	public void deleteById(Long id) {
		
		deviceProductService.deleteById(id);
	}
	
	@PostMapping(value="/find_by_id")
	public DeviceProduct findById(Long id) {
		DeviceProduct deviceProduct = deviceProductService.findById(id);
		return deviceProduct;
	}
}
